package org.gruposp2p.proyectokarma.gwt.client.domain;

import java.util.Set;

import org.gruposp2p.proyectokarma.gwt.client.event.EventBusManager;
import org.gruposp2p.proyectokarma.gwt.client.event.TagsEvent;

public class SessionData implements TagsEvent.Handler{

	private String userName;
	private String selectedTag;
	private boolean userAuthenticated = false;
	private Set<Tag> tagSet;
	
	public SessionData () {
        EventBusManager.getInstance().registerToTagsEvent(this);
	}
	
	public void setUserName(String userName) {
		this.userName = userName;
	}
	public String getUserName() {
		return userName;
	}

	public void setSelectedTag(String selectedTag) {
		this.selectedTag = selectedTag;
	}
	public Set<Tag> getTags() {
		return tagSet;
	}
	
	public String getSelectedTag() {
		return selectedTag;
	}

	public void setUserAuthenticated(boolean userAuthenticated) {
		this.userAuthenticated = userAuthenticated;
	}
	public boolean isUserAuthenticated() {
		return userAuthenticated;
	}

	@Override
	public void onTagsChanged(TagsEvent event) {
		switch (event.eventAction) {
		case OBTAINED:
			tagSet = event.tags;
		break;
	}
		
	}
	
	
}
